<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title></title>
    <#include "/jeecms_sys/head.html"/>
    <#include "/common/image_upload.html"/>
    <script type="text/javascript">
        $(function() {
            $("#jvForm").validate();
        });
        var getProductInfo = function() {
            var productCateId = $("#productCateSelect").val();
            var html = "<option value=''>请选择</option>";
            if("" != productCateId) {
                $.get("../product/a_list.do",{"productCateId":productCateId}, function(data) {
                    var dataObject = eval("("+data+")")
                    for(var index in dataObject) {
                        html+="<option value='"+dataObject[index].id+"'>"+dataObject[index].name+"</option>";
                    }
                    $("#productSelect").html(html);
                });
            }else {
                $("#productSelect").html(html);
            }
        };
        var getSpectInfo = function() {
            var productId = $("#productSelect").val();
            var html = "<option value=''>请选择</option>";
            if("" != productId) {
                $.get("../product/sku/a_list.do",{"productId":productId},function(data) {
                    var dataObject = eval("(" + data + ")");
                    for(var index in dataObject) {
                        html+="<option value='"+dataObject[index].id+"'>"+dataObject[index].skuName+"</option>";
                    }
                    $("#specSelect").html(html);
                });
            }else{
                $("#specSelect").html(html);
            }
        };
    </script>
</head>
<body>
<div class="box-positon">
    <!--<div class="rpos"><@s.m "global.position"/>: <@s.m "productCate.function"/> - <@s.m "global.add"/></div>-->
    <form class="ropt">
        <input type="submit" value="<@s.m "global.backToList"/>" onclick="this.form.action='v_list.do';" class="return-button"/>
    </form>
    <div class="clear"></div>
</div>
<div class="body-box">
    <@p.form id="jvForm" action="o_save.do" labelWidth="12">
        <@p.select colspan="1" id="productCateSelect" onchange="getProductInfo();" width="30" label="商品类别" headerKey="" headerValue="请选择" list=productCates listKey="id" listValue="cateName" required="true" class="required"/>
        <@p.select colspan="1" id="productSelect" name="productId" onchange="getSpectInfo();" name="productId" width="30" label="商品名称" headerKey="" headerValue="请选择" list=products listKey="id" listValue="productName" required="true" class="required"/>
        <@p.select colspan="3" id="specSelect" width="30" name="specificationId" label="商品规格" headerKey="" headerValue="请选择" list=specifications listKey="id" listValue="specification" required="true" class="required"/><@p.tr/>

        <@p.text colspan="1"  width="30" name="startTime" label="开始时间" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate required" required="true"/>
        <@p.text colspan="3"  width="30" name="endTime" label="结束时间" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate required" required="true"/><@p.tr/>
    <!-- 上传图片 -->
    <@p.td label="拼单图片" colspan="1" width="50" noHeight="true">
    <@p.text id="uploadImgPath1" name="imgURL" value="" style="width:220px" class="require" required="true"/>
    <!--  <input type="button" value="<@s.m "imageupload.preview"/>" onclick="previewImg(1);" class="preview-button"/> --><br/>
    <span id="ufc1" style="position:relative">
    <input type='text' id='uploadFileText1' size="14"/>
    <input class="browse" type='button' value='<@s.m "global.browse"/>'/>
    <input onchange="$('#uploadFileText1').val(this.value)" size="14" type="file" id="uploadFile1" class="file-button"/>
    </span>
        <label><input type="checkbox" onclick="$('#mark1').val(this.checked);"/><@s.m "imageupload.mark"/></label>
        <input type="hidden" id="mark1" value="false"/> <input type="button" value="<@s.m "imageupload.upload"/>" onclick="upload(1);" class="upload-button"/><br/>
        <@s.m "global.width"/>: <input type="text" id="zoomWidth1" value="100" size="5"/>
        <@s.m "global.height"/>: <input type="text" id="zoomHeight1" value="70" size="5"/>
        <input type="button" value="<@s.m "imageupload.cut"/>" onclick="imgCut(1);" class="cut-button"/>
    </@p.td>
    <@p.td colspan="1" width="50">
    <img id="preImg1" alt="<@s.m "imageupload.preview"/>" style="width:100px;height:70px;background-color:#CCCCCC;border:1px solid #333"/>
    </@p.td><@p.tr/>
<!-- 图片end -->

        <@p.textarea colspan="3"  width="90" name="content" label="描述" cols="80" rows="3" /><@p.tr/>
         <@p.td colspan="2"><@p.submit code="global.submit"/></@p.td>
</@p.form>

</div>
</body>
</html>